package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzReturnDetailMapper;
import com.ruoyi.system.domain.HmzReturnDetail;
import com.ruoyi.system.service.IHmzReturnDetailService;

/**
 * 归还单子Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-30
 */
@Service
public class HmzReturnDetailServiceImpl implements IHmzReturnDetailService 
{
    @Autowired
    private HmzReturnDetailMapper hmzReturnDetailMapper;

    /**
     * 查询归还单子
     * 
     * @param id 归还单子主键
     * @return 归还单子
     */
    @Override
    public HmzReturnDetail selectHmzReturnDetailById(Long id)
    {
        return hmzReturnDetailMapper.selectHmzReturnDetailById(id);
    }

    /**
     * 查询归还单子列表
     * 
     * @param hmzReturnDetail 归还单子
     * @return 归还单子
     */
    @Override
    public List<HmzReturnDetail> selectHmzReturnDetailList(HmzReturnDetail hmzReturnDetail)
    {
        return hmzReturnDetailMapper.selectHmzReturnDetailList(hmzReturnDetail);
    }

    /**
     * 新增归还单子
     * 
     * @param hmzReturnDetail 归还单子
     * @return 结果
     */
    @Override
    public int insertHmzReturnDetail(HmzReturnDetail hmzReturnDetail)
    {
        hmzReturnDetail.setCreateTime(DateUtils.getNowDate());
        return hmzReturnDetailMapper.insertHmzReturnDetail(hmzReturnDetail);
    }

    /**
     * 修改归还单子
     * 
     * @param hmzReturnDetail 归还单子
     * @return 结果
     */
    @Override
    public int updateHmzReturnDetail(HmzReturnDetail hmzReturnDetail)
    {
        hmzReturnDetail.setUpdateTime(DateUtils.getNowDate());
        return hmzReturnDetailMapper.updateHmzReturnDetail(hmzReturnDetail);
    }

    /**
     * 批量删除归还单子
     * 
     * @param ids 需要删除的归还单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzReturnDetailByIds(Long[] ids)
    {
        return hmzReturnDetailMapper.deleteHmzReturnDetailByIds(ids);
    }

    /**
     * 删除归还单子信息
     * 
     * @param id 归还单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzReturnDetailById(Long id)
    {
        return hmzReturnDetailMapper.deleteHmzReturnDetailById(id);
    }
}
